home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung / Power-Programmierung (Tewi)(1994).iso / magazine / progjour / 1991 / 06 / alib / abort.asm next >
Assembly Source File  |  1991-08-23  |  454b  |  32 lines

  1.     include    asm.inc
  2.  
  3.     public    abort_if_cf
  4.  
  5.     .const
  6. ertx_aborting    db    'Aborting',0
  7.  
  8.  
  9.     .code
  10.     extn    get_strerror,perror,set_strerror,exit_with_failure
  11.  
  12.  
  13. ;;    abort if cf
  14. ;
  15. ;    entry    Cf    error flag, program exits if set (Cf==1)
  16. ;
  17. abort_if_cf proc
  18.     jnc    aic2
  19.     call    get_strerror
  20.     jz    aic1
  21.     movx    si,NULL_POINTER
  22.     call    perror
  23. aic1:    lea    ax,ertx_aborting
  24.     call    set_strerror
  25.     call    perror
  26.     call    exit_with_failure
  27. aic2:    ret
  28. abort_if_cf endp
  29.  
  30.  
  31.     end
  32.